#页面：首页
from selenium.webdriver.common.by import By

from utils.page_base import PageBase #导入页面基类

class PageIndex(PageBase):
    url="/"
    loc_login=By.XPATH,"href,/simple/login"
    loc_searchKw=By.NAME,"word"
    loc_searchButton=By.CSS_SELECTOR,"button.search_submit[type='submit']"


    #功能：打开当前页面
    def openUrl(self):
        self.open(PageIndex.url)

    #功能：点击登录按钮
    def clickLogin(self):
        self.click(PageIndex.loc_login)


    #功能：输入搜索关键字
    def inputSearchKw(self,data):
        self.input(PageIndex.loc_searchKw,data)

    #功能：点击“搜索”按钮
    def clickSearchButton(self):
        self.click(PageIndex.loc_searchButton)


